<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
  <head>
    <title>$Title$</title>
  </head>
  <body>
  <c:choose>
    <c:when test="${books!=null}">
      <table cellpadding="5" cellspacing="0" border="1" align="center" style="margin-top: 50px">
        <tr>
          <th>图书编号</th>
          <th>图书名称</th>
          <th>图书作者</th>
          <th>图书价格</th>
        </tr>
        <c:forEach items="${books}" var="bk">
          <tr>
            <td>${bk.bid}</td>
            <td>${bk.bname}</td>
            <td>${bk.author}</td>
            <td>${bk.price}</td>
          </tr>
        </c:forEach>
      </table>
    </c:when>
  </c:choose>
  <c:choose>
    <c:when test="${book!=null}">
      <table cellpadding="5" cellspacing="0" border="1" align="center" style="margin-top: 50px">
        <tr>
          <th>图书编号</th>
          <th>图书名称</th>
          <th>图书作者</th>
          <th>图书价格</th>
        </tr>
        <tr>
          <td>${book.bid}</td>
          <td>${book.bname}</td>
          <td>${book.author}</td>
          <td>${book.price}</td>
        </tr>
      </table>
    </c:when>
  </c:choose>
  </body>
</html>
